<script setup lang="ts">
  /**
   * 定义props
   */
  defineProps<{
    text: string;
  }>();

  /**
   * 定义emit事件
   */
  type DefinEmits = {
    (event: 'click', payload: unknown): void;
  };
  const emit = defineEmits<DefinEmits>();

  function click(payload: unknown) {
    emit('click', payload);
  }
</script>

<template>
  <button class="oto-botton" @click="click">
    {{ text }}
  </button>
</template>

<style>
  .oto-botton {
    color: red;
  }
</style>
